package com.example.question.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.question.entity.QuestionSet;
import com.example.question.entity.Positions;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 题目集Mapper接口
 * 继承MyBatis-Plus的BaseMapper，提供基础的CRUD操作
 * 用于管理题目集的数据库操作
 * @author 颜殿
 */
@Mapper
public interface QuestionSetMapper extends BaseMapper<QuestionSet> {
    
    /**
     * 根据题目集ID查询关联的职位信息
     * @param id 题目集ID
     * @return 关联的职位信息
     */
    @Select("SELECT p.* FROM interview_positions p " +
            "INNER JOIN interview_question_set qs ON qs.positions_id = p.id " +
            "WHERE qs.id = #{id}")
    Positions selectPositionByQuestionSetId(@Param("id") Long id);
}